import React from 'react';
import CommonBox from './../box/CommonBox.js';
import PostArea from './../box/post.js';
import BoxTitle from './../box/BoxTitle.js';
import Special from './../box/special.js';
import MakImg from './../../static/img/maksdu.png';
import LoveImg from './../../static/img/love.png';
import MarketImg from './../../static/img/market.png';
import BridgeImg from './../../static/img/bridge.png';
import MajaImg from './../../static/img/Maja.png';
import SongImg from './../../static/img/song.png';
import {typeAll} from './../../api';

class Content extends React.Component {
	constructor(props) {
	  super(props);
	  this.state = {
	  	allSpecial:[]
	  };
	}

	componentWillMount() {
		typeAll().then(resp=>{
			console.info(resp);
			if(resp.status==200) {
				this.setState({
				  allSpecial: resp.content
				});
			}
		});
	}


	render() {
		return (
			<div>
				<CommonBox title="论坛" isDress="true"/>
				<PostArea>
					 <BoxTitle title="全部专区">
					 	<div className="fl_tb">
					 		<dl>
					 			
					 			{
					 				this.state.allSpecial.map((special,index)=>(
					 					<dd key={index} style={{float:'left'}}>
					 						<Special obj={special} title={special.name} img={special.icon}/>
					 					</dd>
					 				))
					 			}
					 			
					 		</dl>
					 	</div>
					 </BoxTitle>
					
				</PostArea>
			</div>
		)
	}
}

export default Content
